#ifndef ELEMENTS_RULE_ITEM_TYPE_H
#define ELEMENTS_RULE_ITEM_TYPE_H

#include "common/more/json.h"

#include "permissions.hpp"

#include "element.h"

namespace Elements
{

struct RuleItemType : public Element
{
    RuleItemType() = default;
    RuleItemType(const RuleItemType& other);

    // -- Интерфейс элемента -- //

    virtual bool isSame(Element* other) const override;

    virtual Common::Json toJson() const override;
    virtual void fromJson(const Common::Json& json) override;

    virtual Element* clone() const override;
    virtual ElementType elementType() const override;

    // -- Интерфейс данных -- //

    unsigned ruleId() const;
    void setRuleId(const unsigned value);

    unsigned itemTypeId() const;
    void setItemTypeId(const unsigned value);

    Permissions permissions() const;
    void setPermissions(const Permissions& value);

private:
    unsigned m_ruleId;
    unsigned m_itemTypeId;
    Permissions m_permissions;

};

typedef std::shared_ptr<RuleItemType> RuleItemTypePtr;
typedef std::vector<RuleItemTypePtr> RuleItemTypes;

} // namespace Elements

#endif // ELEMENTS_RULE_ITEM_TYPE_H
